﻿/***************************************************************************
//* Foxit Software Inc.
//* Copyright(C) 2005-2012, all rights reserved.
//*
//* The following code is copyrighted and contains proprietary information
//* and trade secrets of Foxit Software Inc.                                                      *
***************************************************************************/

/**
* 菜单类
*/



define(function (require, exports, module) {
    var FXREADER = require('./FXReader');
    FXREADER.CMenuItem = function (menuItemDefinition) {
        this.m_Name = menuItemDefinition.Name;
        this.m_OnShowFunc = menuItemDefinition.OnShow;
        this.m_OnSelectFunc = menuItemDefinition.OnSelect;
        this.m_CreateHtmlContentFunc = menuItemDefinition.CreateHtmlContentFunc;
        var _self = this;

        this.CreateHtml = function () {
            return _self.m_CreateHtmlContentFunc.call(this);
        }

        this.OnShow = function () {
            if (this.m_OnShowFunc != null) {
                _self.m_OnShowFunc.call(this);
            }
        }

        this.OnSelect = function (jqMenuItem) {
            if (this.m_OnSelectFunc != null) {
                _self.m_OnSelectFunc.call(this, jqMenuItem);
            }
        }

    }

    return FXREADER.CMenuItem;

});